@import "../../../../theme.scss";


:host {
  display: block;
}

.panel{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  transition: all ease-in-out .3s;

  .statistics{
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 14px 36px;
    gap: 10px;
    width: 300px;
    margin-bottom: 10px;
    height: 103px;
    border: 1px solid $primary-color;
    border-radius: 5px;
    transition: all ease-in-out .3s;

    mat-icon{
      width: 44px;
      height: 44px;
      margin-right: 10px;
      font-size: 44px;
    }

    .data-box{
      display: flex;
      align-items: center;
      flex-direction: column;
      width: 147px;

      span:first-child{
        margin-bottom: 10px;
        font-size: 16px;
      }

      span:last-child{
        font-size: 32px;
        line-height: 39px;
      }
    }
  }

  .statistics:nth-child(1) mat-icon{
    color: #673ab7;
  }
  .statistics:nth-child(2) mat-icon{
    color: #e91e63;
  }
  .statistics:nth-child(3) mat-icon{
    color: #3f51b5;
  }
  .statistics:nth-child(4) mat-icon{
    color: #9c27b0;
  }
}


.table-box{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 20px;

  .site-list{
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 49%;
    padding: 14px;
    box-sizing: border-box;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    border: 1px solid $primary-color;

    mat-chip-list{
      display: block;
      width: 100%;
      margin-bottom: 10px;
    }

    .table{
      width: 100%;

      mat-icon.warn{
        color: #FF5252;
      }
      mat-icon.safe{
        color: #4CAF50;
      }
      mat-icon.normal{
        color: #2196F3;
      }
    }
  }

  .power-price{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 49%;

    .power-trend{
      width: 100%;
      padding: 14px;
      margin-bottom: 10px;
      box-sizing: border-box;
      box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05);
      border-radius: 5px;
      border: 1px solid $primary-color;

      h2{
        text-align: center;
      }

      .demo-chart {
        height: 200px;
      }
    }

    .time-electricity-price{
      width: 100%;
      padding: 14px;
      box-sizing: border-box;
      box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05);
      border-radius: 5px;
      border: 1px solid $primary-color;

      h2{
        text-align: center;
      }
      
      .table{
        width: 100%;
      }
    }
  }
}


// 媒体查询部分
@media #{$laptop_screen} {
  .panel{
    justify-content: space-between;

    .statistics{
      margin-bottom: 10px;
      width: 48%;
    }
  }
}

@media #{$pad_screen} {
  .panel{
    justify-content: space-between;

    .statistics{
      margin-bottom: 10px;
      width: 48%;
    }
  }

  .table-box{
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex-wrap: wrap;

    .site-list{
      width: 100%;
      margin-bottom: 30px;
    }

    .power-price{
      width: 100%;
    }
  }
}

@media #{$mobile_screen} {
  .panel{
    justify-content: center;

    .statistics{
      width: 100%;
      margin-bottom: 10px;
    }
    .statistics:last-child{
      margin-bottom: 0;
    }
  }

  .table-box{
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex-wrap: wrap;

    .site-list{
      width: 100%;
      margin-bottom: 30px;
    }

    .power-price{
      width: 100%;
    }
  }
}
